﻿// Referens: https://code.google.com/p/1dv437arkanoid/source/browse/trunk/Collisions/Collisions2/Model/Tile.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Santa_sAdventure.Model.Enums;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Santa_sAdventure.Model
{
    class Tile
    {
        TileType m_type;
        private int m_x = 1;
        private int m_y = 1;
        private Texture2D m_tileTexure = null;

        internal static Tile CreateSolid()
        {
            return new Tile(TileType.Solid);
        }

        internal static Tile CreatePassable()
        {
            return new Tile(TileType.Passable);
        }

        internal static Tile CreateBreakable()
        {
            return new Tile(TileType.Breakable);
        }

        internal static Tile CreateTrap()
        {
            return new Tile(TileType.Trap);
        }

        private Tile(TileType a_type)
        {
            m_type = a_type;
        }

        internal Vector2 GetTileSize()
        {
            return new Vector2(m_x, m_y);
        }

        internal TileType GetTileType()
        {
            return m_type;
        }

        // Get tiletexture
        internal Texture2D GetTexture()
        {
            return m_tileTexure;
        }

        // Set tiletexture
        internal void SetTexture(Texture2D a_texture)
        {
            m_tileTexure = a_texture;
        }

        // Does tile have a textre?
        internal bool HaveTexture()
        {
            return m_tileTexure != null;
        }
    }
}
